<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDistributorApplysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distributor_applys', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 190)->index()->nullable()->comment('申请人姓名');
            $table->string('mobile',20)->index()->nullable()->comment('申请人手机');
            $table->integer('user_id')->index()->default(0)->comment('用户ID');
            $table->integer('pid')->index()->default(0)->comment('申请人父级');
            $table->integer('status')->index()->default(1)->comment('状态 1.审核中、2.审核成功、3.审核不通过');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distributor_applys');
    }
}
